<template>
	<view @click.stop="gotoMaiduanPage"
		:class="{actionBtn: true, actionBtn0: position == 0, actionBtn1: position == 1, actionBtn2: position == 2, actionBtn3: position == 3 }"
		v-if="judgeGopayOrQianyue()">
		买断
	</view>
</template>

<script>
	import {
		checkPosition,
		getOrderId
	} from "../utils/checkShowBtn.js"

	export default {
		name: "maiduan",

		props: {
			order: {
				type: Object,
				default: {},
			}, // 订单对象
			isUsedInList: {
				type: Boolean,
				default: true,
			}, // 是否使用在订单列表页面
		},

		data() {
			return {}
		},

		computed: {
			position: function() {
				return checkPosition.maiduan(this.order, this.isUsedInList)
			}
		},

		methods: {
			//判断按钮是否出现
			judgeGopayOrQianyue() {
				if (this.order.status == '06') {
					return true
				} else {
					return false
				}
			},
			/**
			 ** 点击按钮跳进行页面跳转
			 */
			gotoMaiduanPage() {
				this.$onTo(`/pagesMy/maiduan/maiduan?orderId=${getOrderId(this.order)}`)
			}
		}
	}
</script>

<style>
</style>